package com.rd.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.rd.pojo.SysRole;
import com.rd.pojo.SysUser;
import com.rd.service.SysRoleService;
import com.rd.mapper.SysRoleMapper;
import org.springframework.stereotype.Service;

/**
* @author 20586
* @description 针对表【sys_role】的数据库操作Service实现
* @createDate 2023-10-16 09:01:45
*/
@Service
public class SysRoleServiceImpl extends ServiceImpl<SysRoleMapper, SysRole>
    implements SysRoleService{

    @Override
    public SysRole getRoleByName(String name) {
        //查询条件
        QueryWrapper<SysRole> queryWrapper = new QueryWrapper<>();
        //eq=equals相等
        queryWrapper.eq("name",name);
        return getOne(queryWrapper);//获取单个
    }

}




